//- Copyright (c) 2016 Lucky Byte, Inc.
input(type="hidden" name="serial" value="#{record.serial || ''}")
input(type="hidden" name="uuid" value="#{record.uuid || ''}")
input(type="hidden" name="record"
  value="#{record ? JSON.stringify(record) : ''}")
input(type="hidden" name="diffs"
  value="#{diffs ? JSON.stringify(diffs) : ''}")

h4.ui.dividing.header
  i.caret.down.icon.link.grey.accordion
  | 基本信息

.fields
  .field.sixteen.wide.required
    label 助农取款商户终端:
    .ui.dropdown.selection.labeled.search
      input(type="hidden" name="t60_termid")
      i.icon.dropdown
      .default.text 必填
      .menu
        for term in t60_terms
          - var color = term.shaded ? 'orange' : '#888'
          .item(data-value="#{term.uuid}")= term.termid
            .right.floated(
              style="color:#{color};")
              | #{term.mer_name} ｜ #{term.mer_no} ｜ 
              | #{term.mer_inside ? '平台商户' : '外联商户'} ｜ 
              | #{constant.merch_chnls[term.mer_chnl]}

.fields
  .field.sixteen.wide.required
    label 代付商户终端:
    .ui.dropdown.selection.labeled.search
      input(type="hidden" name="tz1_termid")
      i.icon.dropdown
      .default.text 必填
      .menu
        for term in tz1_terms
          - var color = term.shaded ? 'orange' : '#888'
          .item(data-value="#{term.uuid}")= term.termid
            .right.floated(
              style="color:#{color};")
              | #{term.mer_name} ｜ #{term.mer_no} ｜ 
              | #{term.mer_inside ? '平台商户' : '外联商户'} ｜ 
              | #{constant.merch_chnls[term.mer_chnl]}

.fields
  .field.eight.wide.required
    label 代付手续费:
    .ui.dropdown.selection.labeled.input
      i.icon.yen
      input(type="hidden" name="t60_fee")
      i.icon.dropdown
      .default.text 必填
      .menu
        for fee in fees
          .item(data-value="#{fee.uuid}")
            .right.floated(style="color:#888;") #{fee.notes}
            = fee.name
  .field.eight.wide.required
    label 代理商资金池:
    .ui.dropdown.selection.input
      input(type="hidden" name="p2_fund")
      i.icon.dropdown
      .default.text 必填
      .menu
        for fund in p2_funds
          .item(data-value="#{fund.uuid}")
            .right.floated(style="color:#888;") #{fund.agent}
            = fund.name

.fields
  .field.eight.wide.required
    label 手续费收取方式:
    .ui.dropdown.selection.input
      input(type="hidden" name="fee_take_type")
      i.icon.dropdown
      .default.text 必填
      .menu
        .item(data-value="1") 1. 从代理商资金池中扣取
        .item(data-value="2") 2. 从代付金额中扣取
  .field.eight.wide.required
    label 资金池余额不足时处理方式:
    .ui.dropdown.selection.input
      input(type="hidden" name="fund_lack_proc")
      i.icon.dropdown
      .default.text 必填
      .menu
        .item(data-value="1") 1. 不允许助农取款交易
        .item(data-value="2") 2. 允许助农取款交易，但不允许代付交易
        .item(data-value="3") 3. 透支资金池，超额度时不允许代付交易
        .item(data-value="4") 4. 转从代付金额中扣取手续费

h4.ui.dividing.header
  i.caret.down.icon.link.grey.accordion
  | 代付配置

.fields
  .field.three.wide.required
    label 代付渠道:
    select.ui.dropdown.selection.input.pay_chnl(name="pay_chnl")
      option(value="") 必填
      - for (var k in constant.pay_chnls)
        option(value="#{k}") #{k}. #{constant.pay_chnls[k]}

  .field.thirteen.wide.required
    label 代付渠道商户:
    .ui.dropdown.selection.labeled.search.pay_merid
      input(type="hidden" name="pay_merid")
      i.icon.dropdown
      .default.text 必填
      .menu

h4.ui.dividing.header
  i.caret.down.icon.link.grey.accordion
  | 收款账户

.fields.acct
  .field.three.wide.either
    label 开户人姓名:
    .ui.input.left.icon
      i.icon.user
      input(type="text" name="acct_name" placeholder="姓名和证件号码必填其一")
  .field.five.wide.required
    label 账 号:
    .ui.input.left.icon.acct_no.nofreeze
      i.icon.payment
      input(type="text" name="acct_no")
  .field.three.wide.either
    label 开户人证件类型:
    select.ui.dropdown.input#acct_cred_type(name="acct_cred_type")
      - for (var k in constant.cred_types)
        option(value="#{k}") #{k}. #{constant.cred_types[k]}
  .field.five.wide.either
    label 开户人证件号码:
    .ui.input
      input(type="text" name="acct_cred_no" placeholder="姓名和证件号码必填其一")

.fields.acct
  .field.three.wide
    label 绑定手机号:
    .ui.input.left.icon
      i.icon.tablet
      input(type="text" name="acct_mobile")
  .field.five.wide
    label 开户行行号:
    .ui.input
      input(type="text" name="acct_bank_code")
  .field.eight.wide
    label 开户行名称:
    .ui.input
      input(type="text" name="acct_bank_name")

h4.ui.dividing.header
  i.caret.down.icon.link.grey.accordion
  | 备注信息

.fields
  textarea(name="notes" type="text" rows="3"
    placeholder="在此输入备忘信息")= record.notes || ''
